aboutdialog: Only close on delete events
authorTimm Bäder <mail@baedert.org>
Thu, 18 Jan 2018 13:38:27 +0000 (14:38 +0100)
committerTimm Bäder <mail@baedert.org>
Thu, 18 Jan 2018 13:45:08 +0000 (14:45 +0100)
Clicking on the Credits button should not close the dialog.

gtk/gtkaboutdialog.c

index bc971ac10e2fd835ce10d0938c63364247b4c3fd..3dff6247f948f4722a32ed256013faf91cf65749 100644 (file)
@@ -239,7 +239,6 @@ static void                 set_cursor_if_appropriate       (GtkAboutDialog
 static void                 populate_credits_page           (GtkAboutDialog     *about);
 static void                 populate_license_page           (GtkAboutDialog     *about);
 static void                 populate_system_page            (GtkAboutDialog     *about);
-static void                 close_cb                        (GtkAboutDialog     *about);
 static gboolean             gtk_about_dialog_activate_link  (GtkAboutDialog     *about,
                                                              const gchar        *uri);
 static gboolean             emit_activate_link              (GtkAboutDialog     *about,
@@ -2474,11 +2473,16 @@ gtk_about_dialog_new (void)
 }
 
 static void
-close_cb (GtkAboutDialog *about)
+close_cb (GtkAboutDialog *about,
+          int             response_id,
+          gpointer        user_data)
 {
-  switch_page (about, "main");
+  if (response_id == GTK_RESPONSE_DELETE_EVENT)
+    {
+      switch_page (about, "main");
 
-  gtk_widget_hide (GTK_WIDGET (about));
+      gtk_widget_hide (GTK_WIDGET (about));
+    }
 }
 
 /**